<%--
  Created by IntelliJ IDEA.
  User: JAVA
  Date: 2018/5/17
  Time: 21:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    String userName=request.getParameter("username");
    String password=request.getParameter("password");
    if ("admin".equals(userName)&&"123456".equals(password)) {
        out.write("登录成功");

        //session定义变量，所有的jsp页面都可以访问
        session.setAttribute("isLogin", "true");
        response.sendRedirect("userList.jsp");
    }
    else{
        out.write("登录失败，用户名或密码错误");
    }

%>
</body>
</html>
